package yang.VirtualMachine.chapter9;

import yang.VirtualMachine.chapter9.classStruct.constantPool.PoolValue;

/**
 * 解析的Class 内容存放在此bean中，单利懒汉模式
 * @author xinxin
 */
public class ClassBean {
	public static ClassBean instance; 
	private ClassBean() {
		
	}
	
	public static ClassBean getInstance() {
		if (instance != null) {
			return instance;
		}
		synchronized (ClassBean.class) {
			if (instance != null) {
				return instance;
			} else {
				instance = new ClassBean();
				return instance;
			}
		}
	}
	
	/** 魔数 */
	public String magicNumber;
	/** 小版本号 */
	public long minorVersion;
	/** 大版本号 */
	public long majorVersion;
	/** 常量池大小 */
	public long constantPoolLength;
	/** 常量池 */
	public PoolValue[] constantPool;
	/** 访问标记 */
	public int accessFlag;
	/** 当前类 */
	public String thisClass;
	/** 父类 */
	public String superClass;
	/** 接口数 */
	public int interfacesCount;
	/** 实现接口 */
	public String[] interfaces;
	
	

}
